<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <![endif]-->
    <title>Free Responsive Admin Theme - ZONTAL</title>
    <!-- BOOTSTRAP CORE STYLE  -->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONT AWESOME ICONS  -->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!-- CUSTOM STYLE  -->
    <link href="assets/css/style.css" rel="stylesheet" />
    <!-- HTML5 Shiv and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<header>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <strong>你好， </strong>info@yourdomain.com
                &nbsp;&nbsp;
                <strong><a href="#">退出</a> </strong>+90-897-678-44
            </div>

        </div>
    </div>
</header>
<!-- HEADER END-->
<div class="navbar navbar-inverse set-radius-zero">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">

                <img src="assets/img/logo.png" />
            </a>

        </div>

        <div class="left-div">
            <div class="user-settings-wrapper">
                <ul class="nav">

                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                            <span class="glyphicon glyphicon-user" style="font-size: 25px;"></span>
                        </a>
                        <div class="dropdown-menu dropdown-settings">
                            <div class="media">
                                <a class="media-left" href="#">
                                    <img src="assets/img/64-64.jpg" alt="" class="img-rounded" />
                                </a>
                                <div class="media-body">
                                    <h4 class="media-heading">Jhon Deo Alex </h4>
                                    <h5>Developer & Designer</h5>

                                </div>
                            </div>
                            <hr />
                            <h5><strong>Personal Bio : </strong></h5>
                            Anim pariatur cliche reprehen derit.
                            <hr />
                            <a href="#" class="btn btn-info btn-sm">Full Profile</a>&nbsp; <a href="login.html" class="btn btn-danger btn-sm">Logout</a>

                        </div>
                    </li>


                </ul>
            </div>
        </div>
    </div>
</div>
<!-- LOGO HEADER END-->
<section class="menu-section">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="navbar-collapse collapse ">
                    <ul id="menu-top" class="nav navbar-nav navbar-right">
                        <li><a class="menu-top-active" href="http://localhost:8083/money.html">我的支付宝</a></li>
                        <li><a href="ui.html">账户设置</a></li>
                        <li><a href="http://localhost:8083/dealinfo.html">交易记录</a></li>
                        <li><a href="http://localhost:8083/product.html">商品商城</a></li>
                        <li><a href="http://localhost:8083/coupon.html">商品优惠券</a></li>
                        <li><a href="http://localhost:8083/youhuijuanling.html">我的优惠券</a></li>
                        <li><a href="http://localhost:8083/recycle.html">回收站</a></li>

                    </ul>
                </div>
            </div>

        </div>
    </div>
</section>
<!-- MENU SECTION END-->
<div class="content-wrapper">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <h4 class="page-head-line">
                </h4>

            </div>
            <a class="btn btn-social btn-facebook" href="javaScript:deleteUp()">
                <i class="fa fa-facebook"></i>&nbsp; 批量删除</a>
            <table id="recycle"></table>
        </div>
                </div>
            </div>

<!-- CONTENT-WRAPPER SECTION END-->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                &copy; 2015 YourCompany | By : <a href="http://www.designbootstrap.com/" target="_blank">DesignBootstrap</a>
            </div>

        </div>
    </div>
</footer>
<!-- FOOTER SECTION END-->
<!-- JAVASCRIPT AT THE BOTTOM TO REDUCE THE LOADING TIME  -->
<!-- CORE JQUERY SCRIPTS -->
<script src="assets/js/jquery-1.11.1.js"></script>
<!-- BOOTSTRAP SCRIPTS  -->
<script src="assets/js/bootstrap.js"></script>
<!-- 引入bootstrap-table的js-->
<script src="/assets/table/bootstrap-table.min.js"></script>
<script src="/assets/table/locale/bootstrap-table-zh-CN.min.js"></script>
<!-- 引入bootstrap-table的css -->
<link  href="/table/bootstrap-table.min.css" rel="stylesheet" >
<!-- 引入my97 -->
<script src="/my97/WdatePicker.js"></script>
<!-- 引入bootstrap的js-->
<script src="/bootstrap/js/bootstrap.min.js"></script>
<!-- 引入bootstrap的js-->
<script src="/treeview/bootstrap-treeview.min.js"></script>
<!-- 引入bootstrap的css -->
<link  href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" >
<!-- 引入bootstrap-treeview的css -->
<link  href="/treeview/bootstrap-treeview.min.css" rel="stylesheet" >
<!-- 引入bootbox.js -->
<script src="/bootbox/bootbox.js"></script>
<script>

    //-------------------------------------批量删除------------------------------------
    function deleteUp() {
        var array =  $("#recycle").bootstrapTable('getSelections');
        var ids = new Array();
        for (var i = 0; i < array.length; i++) {
            ids.push(array[i].dealId);  //js操作数组 push()存放元素 pop()删除最后一个元素
        }
        if(ids.length>=1){
            bootbox.dialog({
                title: '删除订单',
                message: '您确定要删除吗？',
                buttons: {
                    cancel: {
                        label: "取消",
                        className: 'btn-danger',
                        callback: function(){
                            return true;
                        }
                    },
                    ok: {
                        label: "确定",
                        className: 'btn-info',
                        callback: function(){
                            $.ajax({
                                url: "http://localhost:8056/dealinfo/deleteBatch",
                                type: "delete",
                                //内容数据类型
                                contentType : 'application/json;charset=utf-8', //设置请求头信息
                               //dataType:"json",//返回值得数据类型
                                data: JSON.stringify(ids),    //将Json对象序列化成Json字符串，JSON.stringify()原生态方法
                                //data: $.toJSON(ids), //将Json对象序列化成Json字符串，toJSON()需要引用jquery.json.min.js
                                success: function(data){
                                    if(data.flag == 1){
                                        bootbox.alert("删除成功");
                                    }else{
                                        bootbox.alert("删除失败");
                                    }
                                    //刷新
                                    $('#deal').bootstrapTable('refresh',{pageNumber:1,pageSize:5});
                                },
                                error: function(){
                                    //ajax请求错误
                                    alert("错误")
                                }
                            })
                        }
                    }}})


        }else{
            //alert("请选择您要删除的数据");
            bootbox.alert("请选择您要删除的数据");
        }

    }
    //---------------------------------回收站查询---------------------------------
    $(function(){
        $('#recycle').bootstrapTable({
            columns:[
                {checkbox:true,}, //复选框
                {field:'dealTime', title:'交易时间',width:100},
                {field:'dealObject',title:'交易人',width:100},
                {field:'dealMoney',title:'交易金额',width:100,sortable:true},
                {field:'dealStatus',title:'交易状态',width:100,
                    formatter:function(value,row,index){//value 当前字段值  row当前行的数据  index当前行
                        if(value==1){
                            return "交易成功";
                        }
                        return "交易失败";

                    }
                },
            ],
            showToggle:true,
            showColumns:true,
            showRefresh:true,
            url:'http://localhost:8056/dealinfo/getRecycle',
            method:'get',
            sortable: false,                     //是否启用排序
            sortName:'proPrice',
            sortOrder:'asc',
            contentType:'application/x-www-form-urlencoded;charset=UTF-8',   //数据编码纯文本  offset=0&limit=5
            toolbar:'#tabToolBar',
        });
    })

</script>
</body>
</html>
